﻿<UserControl x:Class="Clock.Hub"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Foreground="White"
             Loaded="UserControlLoaded" MouseLeftButtonDown="UserControlMouseLeftButtonDown" MouseLeftButtonUp="UserControlMouseLeftButtonUp" MouseMove="UserControlMouseMove"
             Unloaded="UserControlUnloaded">
    <UserControl.RenderTransform>
        <TranslateTransform x:Name="Translate"/>
    </UserControl.RenderTransform>
    <UserControl.Resources>
        <Storyboard x:Key="UnlockAnim" Completed="UnlockAnimCompleted">
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" Duration="0:0:0.35"/>
        </Storyboard>
        <Storyboard x:Key="MoveBackAnim" FillBehavior="Stop" Completed="MoveBackAnimCompleted">
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0" To="0" Duration="0:0:0.14" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0.14" To="-16" Duration="0:0:0.12" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0.26" To="0" Duration="0:0:0.10" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
        </Storyboard>
        <Storyboard x:Key="JumpAnim" FillBehavior="Stop" Completed="JumpAnimCompleted">
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" From="0" To="-30" Duration="0:0:0.18" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0.18" To="0" Duration="0:0:0.14" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0.32" To="-10" Duration="0:0:0.12" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
            <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" BeginTime="0:0:0.44" To="0" Duration="0:0:0.10" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
        </Storyboard>
        <ControlTemplate x:Key="Prev" TargetType="Button">
            <Image Name="Image" Source="Resources/prev.png"/>
        </ControlTemplate>
        <ControlTemplate x:Key="PlayPause" TargetType="ToggleButton">
            <Image Name="Image" Source="Resources/play.png"/>
            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter TargetName="Image" Property="Source" Value="Resources/pause.png"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsChecked" Value="True"/>
                        <Condition Property="IsPressed" Value="True"/>
                    </MultiTrigger.Conditions>
                    <Setter TargetName="Image" Property="Source" Value="Resources/pause.png"/>
                </MultiTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="Next" TargetType="Button">
            <Image Name="Image" Source="Resources/next.png" Opacity="1"/>
        </ControlTemplate>
    </UserControl.Resources>
    <Grid>
        <Image Name="LockScreenBg" Stretch="UniformToFill"/>
        <StackPanel HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="80,0,0,150">
            <TextBlock Name="Day" Text="Wednesday" FontSize="68" FontWeight="Light"/>
            <TextBlock Name="Month" Text="June 01" FontSize="68" FontWeight="Light" Margin="0,-20,0,-40"/>
            <StackPanel Orientation="Horizontal">
                <TextBlock Name="Time" Text="0:00" FontSize="176" FontWeight="Light"/>
                <StackPanel Name="CalendarPanel" Margin="30,0,0,40" Visibility="Collapsed" VerticalAlignment="Bottom">
                    <TextBlock Name="CalendarTitle" FontSize="16" TextTrimming="CharacterEllipsis"/>
                    <TextBlock Name="CalendarLocation" FontSize="16" Visibility="Collapsed"/>
                    <TextBlock Name="CalendarDescription" FontSize="16" Visibility="Collapsed"/>
                    <TextBlock Name="CalendarTime" FontSize="16" TextWrapping="Wrap"/>
                </StackPanel>
            </StackPanel>
            <StackPanel Name="CountersPanel" Orientation="Horizontal" HorizontalAlignment="Left" Visibility="Collapsed">
                <Image Source="Resources/mail.png" Width="32" VerticalAlignment="Center"/>
                <TextBlock Name="UnreadMailCount" Text="0" FontSize="12" FontWeight="Bold" VerticalAlignment="Center"/>
            </StackPanel>
        </StackPanel>
        <DockPanel Name="MusicPanel" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="80,30,0,0" Visibility="Collapsed">
            <Image Name="AlbumArt" Width="120" Height="120" Margin="0,5,0,0"/>
            <StackPanel Orientation="Vertical" Margin="10,0,0,0">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button Name="Prev" Template="{StaticResource Prev}" Margin="0,10,0,10" Click="PrevClick"/>
                    <ToggleButton Name="PlayPause" Template="{StaticResource PlayPause}"  Margin="15,5,15,5" Click="PlayPauseClick"/>
                    <Button Name="Next" Template="{StaticResource Next}" Margin="0,10,0,10" Click="NextClick"/>
                </StackPanel>
                <TextBlock Name="SongTitle" Text="" FontSize="18" Foreground="White" />
                <TextBlock Name="SongArtist" Text="" FontSize="18" Foreground="WhiteSmoke"/>
            </StackPanel>
        </DockPanel>
    </Grid>
</UserControl>
